#include <sw/redis++/redis++.h>
#include <iostream>
using namespace std;

int main()
{
    sw::redis::Redis rd("tcp://127.0.0.1:6379");
    string str = rd.ping();
    cout << str << endl;

    rd.flushdb();
    rd.set("key1","value1");
    rd.set("key2","value2");

    auto v1 = rd.get("key1");
    if(v1)
    {
        cout << v1.value() << endl;
    }
    auto v2 = rd.get("key3");
    if(v2)
    {
        cout << v2.value() << endl;
    }
    return 0;0
}